/ Assembly List / LJCNetCommon / LJCAssemblyReflect / SetFieldInfo

Namespace - LJCNetCommon


Parameters
fieldName - The Field name.

Returns

The FieldInfo value.

Syntax

C#
public FieldInfo SetFieldInfo(String fieldName)

Set the FieldInfo reference. (RE)

Remarks

Sets the FieldName property value and attempts to set the FieldInfo property value if the type reference and the field exist.

Example

C#
using System;
using System.Reflection;
using LJC.Net.Common;

public FieldInfo RetrieveFieldInfo(string assemblyFileSpec, string fullTypeName
  , string fieldName)
{
  FieldInfo retValue = null;

  // These calls are not required if an LJCAssemblyReflect reference is
  // used and the the following set methods have already been executed.
  LJCAssemblyReflect assemblyReflect = new LJCAssemblyReflect();
  Assembly assembly = assemblyReflect.SetAssembly(assemblyFileSpec);
  Type typeReference = assemblyReflect.SetTypeReference(fullTypeName);
    
  retValue = assemblyReflect.SetFieldInfo(fieldName);
  return retValue;
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.